package communication;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import logic.OnlinePlayer;
import logic.PlayRequest;

public class ServerMessage implements Serializable{

	/**
	 * 
	 */
	
	//public final static int MSG_DISCONNECTED = 202;
	
	public final static int MSG_UPDATE_ALL = 201;
	public final static int MSG_PLAYER_IN = 202;
	public final static int MSG_PLAYER_OUT = 203;
	public final static int MSG_NEW_INVITATION = 204;
	public final static int MSG_INVITATION_ACCEPTED = 206;
	public final static int MSG_PLAY_GAME = 207;
	public final static int MSG_CHAT_MSG = 208;
	public static final int MSG_INVITATION_REJECTED = 209;
	public static final int MSG_INVITATION_CANCELED = 210;
	
	private static final long serialVersionUID = 2670170695863310530L;
	
	
	private ArrayList<OnlinePlayer> onlinePlayers;
	private int type;
	private String username="";
	private String msg="";
	private OnlinePlayer player;
	
	public ServerMessage(int type) {
		this.type = type;
		onlinePlayers = new ArrayList<OnlinePlayer>();
	}


	public ArrayList<OnlinePlayer> getOnlinePlayers() {
		return onlinePlayers;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	
	public void setUsername(String username) {
		this.username = username;
	}
	
	public String getUsername() {
		return username;
	}
	
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public String getMsg() {
		return msg;
	}
	
	public OnlinePlayer getPlayer() {
		return player;
	}
	
	public void setPlayer(OnlinePlayer player) {
		this.player = player;
	}
	
}
